<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="../../lib/html5shiv.js?rev=@@hash"></script>
    <script type="text/javascript" src="../../lib/respond.min.js?rev=@@hash"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="../../static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="../../static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="../../lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="../../static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="../../static/h-ui.admin/css/style.css" />
    <link rel="stylesheet" type="text/css" href="../../ht-css/Project.css" />
    <!--[if IE 6]>
    <script type="text/javascript" src="../../lib/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <title>签约信息编辑</title>
</head>
<body>
<nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 客户管理
    <span class="c-gray en">&gt;</span> 合同管理
    <span class="c-gray en">&gt;</span> 签约信息编辑
</nav>
<article class="page-container">
    <form class="ml-20 mr-20" id="form-member-add"  method="post">
        <div class=" pd-5 bg-1 bk-gray mb-20 ">
            <div class="va-m pl-10 lh-50 f-17 f-16">
                <strong>合同管理</strong>
            </div>
            <!--<div class="text-c mb-20">-->
                <!--合同号-->
                <!--<input type="text" name=""  placeholder=" " style="width:250px" class="input-text radius mr-10">-->
                <!--日期范围：-->
                <!--<input type="text" onfocus="WdatePicker({ maxDate:'#F{$dp.$D(\'logmax\')||\'%y-%M-%d\'}' })" id="logmin" class="input-text Wdate radius" style="width:120px;">-->
                <!--~-->
                <!--<input type="text" onfocus="WdatePicker({ minDate:'#F{$dp.$D(\'logmin\')}',maxDate:'%y-%M-%d' })" id="logmax" class="input-text Wdate radius" style="width:120px;">-->
                <!--<label>运营经理:</label>-->
                <!--<input type="text" name="" id="" placeholder=" " style="width:250px" class="input-text radius ml-10">-->
            <!--</div>-->
            <div class="cl">
                <div class="f-l bk-gray pb-10" style="width: 49%">
                        <div class="row ml-10 mt-20">
                            <label class="form-label f-l" style="line-height: 2">价格体系：</label>
                            <select id="price_system" class="select radius" name="brandclass" size="1" style="width:30%; height: 30px;">
                                <!--<option value="1">大客户价格</option>-->
                                <option value="2">品类折扣价</option>
                            </select>
                        </div>
                    <table id="lsit_tab" class="table table-border table-bordered table-striped table-hover table-bg table-sort" id="sign" style="width:96%; margin-left: 2%;margin-top: 10px;">
                        <thead class="">
                        <tr >
                            <td width="150">
                                <span>品类选择</span>
                            </td>
                            <td width="50">
                                <span>品类折扣率</span>
                            </td>
                            <td width="70">
                                输入折扣率
                            </td>
                            <td width="70">
                                <a  class="c-blue" onclick="commodity_add('品类折扣率添加','contr_detail.html','1600','655')">添加</a>
                            </td>
                        </tr>
                        </thead>
                        <thead class="">
                        <tr >
                            <td width="150">
                            </td>
                            <td width="50">
                            </td>
                            <td width="70">
                            </td>
                            <td width="70">
                            </td>
                        </tr>
                        </thead>
                    </table>
                </div>
            </div>
            <div class=" pd-5 bg-1 bk-gray mt-10 cl mb-20">
                <div class="ml-10  f-l" style="width: 40%;">
                    <div class="pl-10 f-14 f-l lh-30 mr-30 mt-10">
                        <strong>品类管理</strong>
                    </div>
                    <div class="row ml-10 mt-10">
                        <label class="form-label f-l" style="line-height: 2">范围：</label>
                        <select  id="whole_data" class="select radius" onclick="discount()" id="daku"  name="brandclass" size="1" style="width:30%; height: 30px; float: left">
                            <!--<option disabled="disabled" selected>请选择</option>-->
                            <!--<option value="1">品类</option>-->
                            <option value="0">全部</option>
                        </select>
                        <div id="tishui" style="width:30%; height: 30px; line-height: 32px; color: #ab0b02; float: left; padding-left: 20px;"></div>
                        <div style="clear:both;"></div>
                    </div>
                    <div class="line mt-10 mb-20"></div>
                    <div class="wrapBox flex cl mb-20 ">
                        <ul class="cell_1 yesList dataList bk-gray f-l radius " data-types="0" id="category_lsit">
                            <!--<li class="list_item"><input type="checkbox" class="checkBox" value="电工电料/电工电料/电气l1" name="checkboxName"><span class="checkout_val">电工电料/电工电料/电气</span></li>
                            <li class="list_item"><input type="checkbox" class="checkBox" value="电工电料/电工电料/电气l2" name="checkboxName"><span class="checkout_val">电工电料/电工电料/电气</span></li>-->
                        </ul>
                        <div class="cell_0 arrow_box">
                            <div class="no_arrow public_ico " id="noBtn" data-type="1" onclick="Index.bindEvent('1')"></div>
                            <div class="yes_arrow public_ico" id="yesBtn" data-type="0" onclick="Index.bindEvent('0')"></div>
                        </div>
                        <ul class="cell_1 noList  noList_r dataList f-r radius " data-types="1" id="category_right">
                            <!--<li class="list_item"><input type="checkbox" class="checkBox" value="电工电料/电工电料/电气r1" name="checkboxName" txt="电工电料/电工电料/电气r1"><span class="checkout_val">电工电料/电工电料/电气</span></li>-->
                            <!--<li class="list_item"><input type="checkbox" class="checkBox" value="电工电料/电工电料/电气r2" name="checkboxName" txt="电工电料/电工电料/电气r1"><span class="checkout_val">电工电料/电工电料/电气</span></li>-->
                        </ul>
                        </div>
                    </div>
                <div class="row f-r mr-10" style="width: 50%;position: relative">
                    <div class="dingw_no"></div>
                    <div class="pl-10 f-14 lh-30 mr-30 mt-10">
                        <strong>SKU管理</strong>
                    </div>
                    <div class="line mt-10 mb-20"></div>
                    <div class="bk-gray">
                        <div class="row ml-20 mt-20" >
                            <label class="form-label c-error"><span class="c-error">* 请输入需要添加或删除的SKU，5（500个SKU限制</span></label>
                            <div class="formControls mb-10" style="width: 95%;">
                                <textarea name="abstract" class="textarea" value="123"></textarea>
                            </div>
                            <div class="" style="margin:0 auto; width: 280px;">
                                <input id="bottm" type="submit" type="button" class="btn btn-secondary radius size-S botter " value="&nbsp;提&nbsp;&nbsp;交&nbsp;">
                                <input name="" type="reset" class="btn radius size-S botter ml-10" value="&nbsp;删&nbsp;&nbsp;除&nbsp;">
                                <input name="" type="reset" class="btn radius size-S botter ml-10" value="&nbsp;重&nbsp;&nbsp;置&nbsp;">
                            </div>
                            <label class="form-label c-error mt-20"><span class="c-error">* 多于500个SKU，请使用此功能上传</span></label>
                            <span class="btn-upload form-group mb-20">
                          <input class="input-text upload-url radius mr-10" type="text" name="uploadfile-1" id="uploadfile-1" readonly>
                             <a href="javascript:void();" class="btn radius mr-10 botter c-black">加载</a>
                             <input type="file" multiple name="file-1" class="input-file">
                        </span>
                            <a class="btn botter radius mr-10 c-black mb-20">添加</a>
                            <a class="btn btn-primary radius mb-20">下载模板</a>
                        </div>
                    </div>
                </div>
                <div style="clear:both"></div>
                <table class="table-hover table_li ml-10" >
                    <thead class="text-l">
                    <tr>
                        <td >
                            <span>合同额度: <span id="contract_credit"></span></span>
                        </td>
                        <td >
                            <span>信用额度:<span id="credit"></span></span>
                        </td>

                        <td >
                            <span>执行赊欠额度: <span id="tick_quota"></span></span>
                        </td>
                    </tr>
                    <tr>
                        <td >
                            <span>执行结算周期: <span id="balance_day"></span></span>
                        </td>
                    </tr>
                    <tr>
                        <td >
                            <span>合同结账周期: <span id="checkout_cycle"></span></span>
                        </td>
                    </tr>
                    </thead>
                </table>
                <!--<div class="pl-10 lh-30 mb-10 mt-10">-->
                    <!--绿色通道附件:-->
                    <!--<a href=""><i class="Hui-iconfont f-20 mt-10">&#xe610;</i></a>-->
                    <!--请上传绿色通道邮件附件-->
                    <!--</span>-->
                <!--</div>-->
            </div>
        </div>
        <div class="text-c">
            <input id="" type="submit" onclick="submission()" type="button" class="btn btn-secondary radius size-S" value="提&nbsp;&nbsp;交">
            <input name="" type="reset" onclick="cancel()" class="btn radius size-S ml-10" value="取&nbsp;&nbsp;消">
        </div>
        <div class="mt-20 text-c mb-20">
            鑫方盛电子商务股份有限公司提供支持
        </div>
    </form>
</article>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="../../lib/jquery/1.9.1/jquery.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../lib/layer/2.4/layer.js?rev=@@hash"></script>
<script type="text/javascript" src="../../static/h-ui/js/H-ui.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../static/h-ui.admin/js/H-ui.admin.js?rev=@@hash"></script> <!--/_footer 作为公共模版分离出去-->
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="../../lib/My97DatePicker/4.8/WdatePicker.js?rev=@@hash"></script>
<!--表单验证-->
<script type="text/javascript" src="../../lib/jquery.validation/1.14.0/jquery.validate.js?rev=@@hash"></script>
<script type="text/javascript" src="../../lib/jquery.validation/1.14.0/validate-methods.js?rev=@@hash"></script>
<script type="text/javascript" src="../../lib/jquery.validation/1.14.0/messages_zh.js?rev=@@hash"></script>
<script type="text/javascript" src="../../lib/datatables/1.10.0/jquery.dataTables.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../lib/laypage/1.2/laypage.js?rev=@@hash"></script>
<script src="../../ht-js/public.js?rev=@@hash"></script>
<!--验证token-->
<script src="../../ht-js/verifyToken.js?rev=@@hash"></script>
<script src="../../ht-js/contract/oods_pool.js?rev=@@hash"></script>
<script>
    /*var customerId=getQueryString('customerId');
    customerCode=getQueryString('id');
    contract_num=getQueryString('contract_num');*/
    var customerCode=getQueryString('id'),
        customerId=getQueryString('customerId'),
        contractID=getQueryString('contractID');

    //品类折扣率添加
    /*function commodity_add(title,url,w,h){
        layer_show(title,url+'?customerId='+customerId+'&id='+customerCode,w,h);
    }*/
    function commodity_add(title, url) {
        sessionStorage.setItem("id",customerCode);
        sessionStorage.setItem("customerId",customerId);
        sessionStorage.setItem("contractID",contractID);
        var index = layer.open({
            type: 2,
            title: title,
            content: url
        });
        layer.full(index);
    }
    web.loadMyk();
    function submission() {
        var user_data = {
            contractId:getQueryString('contractID'),
            priceSystem: $("#price_system").val()
        }
        var succCallBack = function (data, status, response) {
            console.log(data)
            if(data.errorCode=="0"){
                layer.msg('修改成功', {icon: 6,time:1000});
                setTimeout( function () {
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index);
                },1000);
            }
        };
        web.doAjax(root.inter.updateSignInfo,'post',user_data, succCallBack);
    }
    $(function(){
        $("#form-member-add").validate({
            rules: {
                username: {
                    /*required: true,*/
                },
            },
            onkeyup: false,
            focusCleanup: true,
            success: "valid",
            submitHandler:function(form){
            }
        })
        var price_system=decodeURI(escape(getQueryString('price_system'))),
            express_policy=decodeURI(escape(getQueryString('express_policy'))),
            credit=decodeURI(escape(getQueryString('credit'))),
            contract_credit=decodeURI(escape(getQueryString('contract_credit'))),
            tick_quota=decodeURI(escape(getQueryString('tick_quota'))),
            checkout_cycle=decodeURI(escape(getQueryString('checkout_cycle'))),
            payment_date=decodeURI(escape(getQueryString('payment_date'))),
            balance_way=decodeURI(escape(getQueryString('balance_way'))),
            balance_day=decodeURI(escape(getQueryString('balance_day'))),
            balance_remark=decodeURI(escape(getQueryString('balance_remark')));
            var settle_cycle_first=decodeURI(escape(getQueryString('settle_cycle_first')));
            var settle_cycle_second=decodeURI(escape(getQueryString('settle_cycle_second')));
            var settle_cycle_third=decodeURI(escape(getQueryString('settle_cycle_third')));

            if (settle_cycle_first == 'null'){
                settle_cycle_first = ''
            }
            if (settle_cycle_first == 1){
                settle_cycle_first = "当"
            }
            if (settle_cycle_first == 2){
                settle_cycle_first = "次"
            }
            if (settle_cycle_first == 3){
                settle_cycle_first = "第三个"
            }
            if (settle_cycle_first == 4){
                settle_cycle_first = "第四个"
            }
            if (settle_cycle_first == 5){
                settle_cycle_first = "第五个"
            }
            if (settle_cycle_first == 6){
                settle_cycle_first = "第六个"
            }
            if (settle_cycle_second == 'null'){
                settle_cycle_second = ''
            }
            if (settle_cycle_third == 'null'){
                settle_cycle_third = ''
            }
            if(balance_day=="undefined"){
                balance_day=''
            }
            if(balance_remark=='null'){
                balance_remark=''
            }
            $('#credit').text(credit)
            $('#payment_date').text(payment_date)
            $('#balance_way').text(balance_way)
            $('#balance_day').text(settle_cycle_first +"月"+settle_cycle_second+"日前，结算"+settle_cycle_third+"日之前所有货款")
            $('#balance_remark').text(balance_remark)
            $('#contract_credit').text(contract_credit)
            $('#tick_quota').text(tick_quota)
            $('#checkout_cycle').text(checkout_cycle)
        //折扣率
        if(price_system==1){
                $("#price_system").val(1)
                $('#lsit_tab').hide();
        }else {
            $("#price_system").val(2)
        }
        function discount() {
            $("#price_system").change(function(event) {
                var fanx = $(this).find("option:selected");
                if(fanx.val()==2){
                    $("#lsit_tab").show();
                }else{
                    $('#lsit_tab').hide();
                }
            });
            $("#discint").change(function(event) {
                var fanx = $(this).find("option:selected");
                if(fanx.val()!=="0"){
                    $('#expect').hide();
                }else{
                    $("#expect").show();
                }
            });
        }
        discount()
    });
    commoditypool()

</script>
</body>
</html>